/**
 * 通用工具函数
 * @author Lee
 */
const CODE = {
    SUCCESS: 200,
    PARAM_ERROR: 10001, //参数错误
    USER_ACCOUNT_ERROR: 20001, //账号或密码错误
    USER_LOGIN_ERROR: 30001, //用户未登录
    BUSINESS_ERROR: 40001, //业务请求失败
    AUTH_ERROR: 50001 //认证失败或TOKEN过期
}
module.exports = {
    success(data = '', msg = 'ok', code = CODE.SUCCESS) {
        return {
            data, msg, code
        }
    },
    fail(data = '', msg = 'fail', code = CODE.BUSINESS_ERROR) {
        return {
            data, msg, code
        }
    }
}